﻿using RuoVea.OmiApi.UserRoleMenu.Service;
using RuoVea.OmiApi.UserRoleMenu.Service.Dto;

namespace RuoVea.Swms.Web.Controllers
{
    /// <summary>
    /// 
    /// </summary>
    [Authorize]
    public class HomeController : Controller
    {
        private readonly SysMenuService _sysMenuService;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sysMenuService"></param>
        public HomeController(SysMenuService sysMenuService) {
            _sysMenuService = sysMenuService;
        }

        public IActionResult Index()
        {
            return View();
        }

        public IActionResult nomal()
        {
            return View();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        [HttpGet("user/Menu")]
        public async Task<List<MenuOutput>> Menu() {
            return await _sysMenuService.GetLoginMenuTree();
        }
    }
}
